import { useResponseSuccess } from '~/utils/response';

export default eventHandler(async (event) => {
  const windowId = getRouterParam(event, 'id');
  const body = await readBody(event);

  // 模拟更新窗口状态
  const result = {
    windowId,
    status: body.status,
    updateTime: new Date().toISOString(),
    message: `窗口状态已更新为: ${body.status}`,
  };

  return useResponseSuccess(result);
});
